import request from "@/util/axios";
import downloadRequest from "@/util/downloadUtil";

export const reSort = (data) =>
    request({
        url: "/api/manga/ep/reSort",
        method: "post",
        data: data
    })

export const createEp = (data) =>
    request({
        url: "/api/manga/ep/save",
        method: "post",
        data: data
    })

export const rename = (data) =>
    request({
        url: "/api/manga/ep/update",
        method: "post",
        data: data
    })

export const epAvailable = (data) =>
    request({
        url: "/api/manga/ep/available",
        method: "post",
        data: data
    })

export const epDeleted = (data) =>
    request({
        url: "/api/manga/ep/deleted",
        method: "post",
        data: data
    })

export const rawList = (epId) =>
    request({
        url: "/api/manga/ep/rawList",
        method: "get",
        params: {
            epId
        }
    })

export const cookedList = (epId) =>
    request({
        url: "/api/manga/ep/cookedList",
        method: "get",
        params: {
            epId
        }
    })

export const deletedRaw = (epId, pageId) =>
    request({
        url: "/api/manga/ep/deletedRaw",
        method: "get",
        params: {
            epId,
            pageId
        }
    })

export const clearRaw = (epId) =>
    request({
        url: "/api/manga/ep/clearRaw",
        method: "get",
        params: {
            epId
        }
    })

export const deletedCooked = (epId, pageId) =>
    request({
        url: "/api/manga/ep/deletedCooked",
        method: "get",
        params: {
            epId,
            pageId
        }
    })

export const clearCooked = (epId) =>
    request({
        url: "/api/manga/ep/clearCooked",
        method: "get",
        params: {
            epId
        }
    })

export const reSortRawList = (data) =>
    request({
        url: "/api/manga/ep/reSortRawList",
        method: "post",
        data: data
    })

export const reSortCookedList = (data) =>
    request({
        url: "/api/manga/ep/reSortRawList",
        method: "post",
        data: data
    })

export const submitExport = (params) =>
    request({
        url: "/api/manga/ep/export",
        method: "post",
        data: params
    })

export const exportText = (epId) =>
    downloadRequest({
        url: "/api/manga/ep/exportText",
        method: "get",
        params: {
            epId
        },
    })